package com.pig.service.impl;

import com.pig.dao.AddrMapper;
import com.pig.dao.ShopMapper;
import com.pig.pojo.addr.Addr;
import com.pig.pojo.order.Order;
import com.pig.pojo.shop.Shop;
import com.pig.pojo.user.User;
import com.pig.service.ShopService;
import com.pig.util.SysResultLayui;
import com.pig.vo.ShopTable;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopServiceImpl implements ShopService {
    @Autowired
    private ShopMapper shopMapper;
    @Autowired
    private AddrMapper addrMapper;

    @Override
    public SysResultLayui findUserByPage(int page, int limit) {
        int startIndex = (page-1)*limit;
        int count = shopMapper.selectCount(null);
        List<ShopTable> itemList = shopMapper.findUserByPage(startIndex, limit);
        System.out.println(itemList);
        return new SysResultLayui(200,"OK",count,itemList);
    }

    @Override
    public void updateUsers(String orderId) {
        shopMapper.updateById(orderId);

    }

    @Override
    public void updateStatus(String orderId) {
        shopMapper.updateStatus(orderId);
    }
}
